package com.example.spring_seatreservation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.spring_seatreservation.entity.Floor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FloorMapper extends BaseMapper<Floor> {

    @Select("select t.*,l.name as library_name from floor t " +
            "left join library l on l.id = t.lib_id")
    List<Floor> getFloorList();

    @Select("select count(1) from floor where lib_id = #{libId}")
    int selectFloorByLibId(Long libId);
}
